import Vue from 'vue'
import App from './App.vue'
import router from './router'
import ElementUI from 'element-ui' // 导入elementui组件库
import 'element-ui/lib/theme-chalk/index.css' // 导入组件相关样式
import './styles/common.scss'
import { resetRem } from '@/utils/setRem'
import store from './store'
import './permission'
import '@/utils/base'
resetRem()
const requireComponent = require.context('./components', false, /\.vue$/)
requireComponent.keys().forEach(fileName => {
  const componentConfig = requireComponent(fileName)
  const componentName = fileName.replace(/^\.\//, '').replace(/\.vue/, '')
  Vue.component(componentName, componentConfig.default || componentConfig)
})

// 阻止显示生产模式的消息
Vue.config.productionTip = false

Vue.use(ElementUI) // 配置vue插件

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
